///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package tcubeappclient;
//
//import BusinessLogic.CustomerBeanLocal;
//import BusinessLogic.PartnerBeanLocal;
//import BusinessLogic.TCubeBeanLocal;
//import Entity.Cubes;
//import Entity.Partner;
//import Entity.TermsAndConditions;
//import Exception.ExistException;
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Scanner;
//
//
///**
// *
// * @author GT
// */
//public class Engine {
//    
//    Scanner sc = new Scanner(System.in);
//    
//    private CustomerBeanLocal cb;
//    private PartnerBeanLocal pb;
//    private TCubeBeanLocal tb;
//    
//    Cubes cube;
//    
//    public Engine() {
////        cb = Main.customerBean;
//        pb = Main.partnerBean;
//        tb = Main.tCubeBean;
//    }
//    
//    //Customer
//    
//    /*public void buyVoucher() {
//        System.out.println("Enter cube id");
//        long cubeId = Long.parseLong(sc.nextLine());
//        System.out.println("Enter user name");
//        String userName = sc.nextLine();
//        System.out.println("Enter quantity");
//        int quantity = Integer.parseInt(sc.nextLine());
//        cb.buyVoucher(cubeId, userName, quantity);
//    }
//    
//    public void customerCheckVoucher() {
//        System.out.println("Enter voucher Id");
//        long cubeVoucherId = Long.parseLong(sc.nextLine());
//        if (pb.checkVoucher(cubeVoucherId) == 1) {
//            System.out.println("The voucher " + cubeVoucherId + " has been redeemed.");
//        }
//        else if (pb.checkVoucher(cubeVoucherId) == 0) {
//            System.out.println("The voucher " + cubeVoucherId + " is not redeemed yet.");
//        }
//    }
//    
//    
//    //Partner
//    
//    public void createCube() {
//        System.out.println("name");
//        String name = sc.nextLine();
//        System.out.println("description");
//        String description = sc.nextLine();
//        System.out.println("price");
//        long price = 12;
//        System.out.println("discount");
//        int discount = 20; // Same as item's discount but it would not be stacked. In other words, the final price will be calculated based on this discount and ORIGINAL price, not the DISCOUNTED item price.
//        System.out.println("startDate");
//        long startDate = 123;
//        System.out.println("endDate");
//        long endDate = 123;
//        System.out.println("partner id");
//        long partnerId = Long.parseLong(sc.nextLine());
//        Partner partner = pb.viewPartner(partnerId);
//        System.out.println("terms id");
//        long termsId = Long.parseLong(sc.nextLine());
//        TermsAndConditions terms = pb.viewTerms(termsId);
//        pb.createCube(name, description, price, discount, startDate, endDate, partner, terms);
//    }
//    
//    public void getCubes() {
//        List cubes = new ArrayList<Cube>();
//        cubes = pb.getCubes();
//        for (int i=0; i<cubes.size(); i++) {
//            System.out.println(cubes.get(i));
//        }
//        
//    }
//    
//    public void viewCube() {
//        System.out.println("Enter cube Id");
//        long cubeId = Long.parseLong(sc.nextLine());
//        cube = pb.viewCube(cubeId);
//        System.out.println(cube.getName());
//    }
//    
//    public void updateCube() {
//        System.out.println("Enter cube Id:");
//        long cubeId = Long.parseLong(sc.nextLine());
//        System.out.println("Enter Name:");
//        String name = sc.nextLine();
//        System.out.println("Enter Description:");
//        String description = sc.nextLine();
//        System.out.println("Enter Price:");
//        long price = Long.parseLong(sc.nextLine());
//        System.out.println("Enter Discount:");
//        int discount = Integer.parseInt(sc.nextLine());
//        System.out.println("Enter Start Date:");
//        long startDate = Long.parseLong(sc.nextLine());
//        System.out.println("Enter End Date:");
//        long endDate = Long.parseLong(sc.nextLine());
//        System.out.println("Enter Partner Id:");
//        long partnerId = Long.parseLong(sc.nextLine());
//        Partner partner = pb.viewPartner(partnerId);
//        System.out.println("Enter Terms Id:");
//        long termsId = Long.parseLong(sc.nextLine());
//        TermsAndConditions terms = pb.viewTerms(termsId);
//        pb.updateCube(cubeId, name, description, price, discount, startDate, endDate, partner, terms);
//    }
//    
//    public void delCube() throws ExistException {
//        System.out.println("Enter cube Id");
//        long cubeId = Long.parseLong(sc.nextLine());
//        if (pb.delCube(cubeId) == 1) {
//            System.out.println("Cube \"" + cubeId + "\" is deleted successfully.");
//        }
//        else {
//            System.out.println("Deletion of cube \"" + cubeId + "\" fails.");
//        }
//    }
//    
//    public void partnerCheckVoucher() {
//        System.out.println("Enter voucher Id");
//        long cubeVoucherId = Long.parseLong(sc.nextLine());
//        if (pb.checkVoucher(cubeVoucherId) == 1) {
//            System.out.println("The voucher " + cubeVoucherId + " has been redeemed.");
//        }
//        else if (pb.checkVoucher(cubeVoucherId) == 0) {
//            System.out.println("The voucher " + cubeVoucherId + " is not redeemed yet.");
//        }
//    }
//    
//    public void redeemCubeVoucher() {
//        long cubeVoucherId = Long.parseLong(sc.nextLine());
//        System.out.println(pb.redeemVoucher(cubeVoucherId));
//    }
//    
//    //MISC
//    
//    public void createPartner() {
//        String name = "Partner1";
//        String businessAddress1 = "Jurong";
//        String businessAddress2 = "Street 20"; 
//        String businessPostalCode = "640404";
//        String billingAddress1 = "Jurong";
//        String billingAddress2 = "Street 20";
//        String billingPostalCode = "640404";
//        String countryCode = "65";
//        String phone = "1234567";
//        String country = "Singapore";
//        String province = "Singapore";
//        String city = "Singapore";
//        String businessEmail = "imaboss@partner1.com";
//        int sector = 1;
//        boolean branch = false;
//        pb.createPartner(name, businessAddress1, businessAddress2, businessPostalCode, billingAddress1, billingAddress2, billingPostalCode, countryCode, phone, country, province, city, businessEmail, sector, branch);
//    }
//    
//    public void createUser() {
//        System.out.println("before hardcoding");
//        System.out.println("Enter username");
//        String username = sc.nextLine();
//        String password = "password";
//        String IC = "S8888888A";
//        String firstName = "Tan"; 
//        String lastName = "Ah Kow";
//        String gender = "Male";
//        String countryCode = "65";
//        String phone = "91919191";
//        String email = "tanahkow@abc.com";
//        String country = "Singapore";
//        String city = "Singapore";
//        long birthday = 123;
//        System.out.println("before creating");
//        pb.createUser(username, password, IC, firstName, lastName, gender, countryCode, phone, email, country, city, birthday);
//    }
//    
//    public void createTerms() {
//        System.out.println("Enter name");
//        String name = sc.nextLine();
//        System.out.println("Enter content");
//        String content = sc.nextLine();
//        pb.createTerms(name, content);
//    }*/
//}
